OrderGridCtl = Ext.extend(GridCtl, {

			getCmItems : function() {

				var items = [
						this.getCmItem('任务编号', 'id', true),
						this.getCmItem('状态', 'status', true),
						this.getCmItem('任务类型', 'type', true),
						this.getCmItem('创建人id', 'createuser', false),
						this.getCmItem('创建人', 'createusername', true),
						this.getCmItem('创建时间', 'createtime', true),
						this.getCmItem('审核人id', 'verifyuserid', false),
						this.getCmItem('审核人', 'verifyuser', true),
						this.getCmItem('审核时间', 'verifytime', true),
						this.getCmItem('经理id', 'pmgrid', false),
						this.getCmItem('经理名称', 'pmgrname', true),
						this.getCmItem('开始时间', 'workstarttime', true),
						this.getCmItem('完成时间', 'workfinishtime',
										true),
						this.getCmItem('确认完成人id', 'pastid', false),
						this.getCmItem('确认完成人', 'pastname', true),
						this.getCmItem('确认完成时间', 'pasttime', true),
						this.getCmItem('部门id', 'departmentid', false),
						this.getCmItem('部门', 'depname', true),
						this.getCmItem('协议单编号', 'contractid', true),
						this.getCmItem('根协议单编号', 'rootid', true)

				];

				return items;
			},
			configButtons : function(config) {

				var buttons = [{
							text : '添加订单',
							handler : this.addOrder,
							scope : this
						}, {
							text : '删除订单',
							handler : this.delOrder,
							scope : this
						}, {
							text : '详细信息',
							handler : this.showDetail,
							scope : this
						}];

				config.buttonAlign = 'left';
				config.buttons = buttons;

				return config;

			},
			getCommonConfig : function() {
				

				var config = {
					region : 'south',
					height : cf.getC('gcc').sh*0.4
				};

				return config;

			},
			addOrder : function() {

				var id = this.contractId;
				var owc = cf.getC('owc');
				owc.show(id);

			},
			delOrder : function() {

				var recordList = this.getSelectList();
				if (!recordList) {
					alert('请先选择一条记录！');
					return;
				}
				var idList = this.getItemsList(recordList);

				var s = cf.getC('s');

				var para = {
					resource : 'task.do',
					act : 'delete',
					params : {
						itemlist : Ext.encode(idList)
					},
					cbf : this.delSuccess,
					scope : this
				};
				s.request(para);

			},
			delSuccess : function() {
				this.reload();
			},
			showDetail : function() {

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var oswc = cf.getC('oswc');
				oswc.show(record.get('id'));
			},
			load : function(id) {

				this.contractId = id;

				var store = this.store;
				store.baseParams = {
					id : id
				};
				store.load();

			},
			getStoreUrl : function() {

				var resource = 'contract.do';
				var server = cf.getC('s');
				var url = server.getUrl({
							resource : resource,
							act : 'taskall'
						});
				return url;
			}

		});
